﻿Public Class Main
    Inherits System.Web.UI.MasterPage
    Dim objUser As New LoginHelper("", "")
    Dim dm As New DanhMuc_BLL()
    Dim p As New DanhMuc_DTO()
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Try
            load_DanhMuc()
            objUser = TryCast(Session("sesLoginUser"), LoginHelper)
        Catch
        End Try
        If objUser IsNot Nothing Then
            lb_login.Visible = False
            lb_loginname.Text = "Xin chào, " + objUser.UserName
            bt_logout.Visible = True
        Else
            lb_login.Visible = True
            lb_loginname.Visible = False
            bt_logout.Visible = False
        End If

    End Sub

    Protected Sub bt_logout_Click(ByVal sender As Object, ByVal e As EventArgs) Handles bt_logout.Click
        Session.Remove("sesLoginUser")
        Response.Redirect("Default.aspx")
    End Sub

    Public Sub load_DanhMuc()

        dtl_danhmuc.DataSource = dm.DanhMuc()
        dtl_danhmuc.DataBind()
        

    End Sub
    Protected Sub search(ByVal sender As Object, ByVal e As System.EventArgs) Handles bt_timkiem.ServerClick
        Response.Redirect("BookSearch.aspx?search=" + txt_timkiem.Value)
    End Sub
    Protected Sub dtl_danhmuc_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles dtl_danhmuc.ItemCommand

    End Sub
End Class